package com.lancoo.ccas53.service;

import cn.hutool.http.HttpResponse;
import com.lancoo.ccas53.pojo.response.Scheme;
import com.lancoo.ccas53.pojo.response.basicPlatform.*;
import com.lancoo.ccas53.pojo.response.digitization.BuildingInfo;
import com.lancoo.ccas53.pojo.response.score.Retake;
import com.lancoo.ccas53.pojo.vo.MsgCoursePlanExamine;
import com.lancoo.ccas53.pojo.vo.MsgTimeAdjustment;
import com.lancoo.ccas53.util.ResponseObject;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @ClassName YunBasicService
 * @Description TODO
 * @Author quin
 * @Date 2024/5/20 19:34
 */
public interface YunBasicService {


    /**
     * 获取子系统地址，优先获取内网地址
     *
     * @param sysIDs
     * @param isInner true获取内网地址 false获取外网地址
     * @return
     */
    SubSystemsMainServer getSubSystemsMainServer(String sysIDs, Boolean isInner);


    /**
     * 获取学期信息
     *
     * @param schoolId
     * @return
     */
    List<TermBasicInfo> getAllTermInfo(String schoolId);

    /**
     * 获取当前学期
     *
     * @param schoolId
     * @return
     */
    CurrentTermInfo getCurrentTermInfo(String schoolId);

    /**
     * 根据token获取用户数据
     *
     * @param token
     * @return
     */
    UserInfo getUserInfoByToken(String token);

    /**
     * 获取用户权限
     *
     * @param userId
     * @param token
     * @return
     */
    List<IdentifyType> getIdentityTypeByUserID(String userId, String token);

    /**
     * 获取加密锁信息
     *
     * @param schoolId
     * @return
     */
    LockerInfo getSubSystemLockerInfoByID(String schoolId);

    Integer logout(String userId, String token);

    /**
     * 同步教学计划  专业  课程 环节 学生
     *
     * @param taskId
     * @param schoolId
     * @return
     */
    List<Scheme> getBasePlanTeaching(Integer taskId, String schoolId);

    /**
     * 获取基础平台教室
     *
     * @param schoolId
     * @return
     */
    List<BuildingInfo> getBaseRoom(String schoolId);

    /**
     * 获取全部学院信息 包括专业 年级 管理员信息
     *
     * @param schoolId
     * @return
     */
    List<BaseCollege> getCollege(String schoolId);

    /**
     * 获取基础平台学生
     *
     * @param schoolId
     * @return
     */
    List<BaseStudent> getStudent(String schoolId);


    /**
     * 获取教师
     *
     * @param schoolId
     * @return
     */
    List<BaseTeacher> getTeacher(String schoolId);

    /**
     * 获取课时方案
     *
     * @param schoolId
     * @return
     */
    List<BasePeriodScheme> getPeriodScheme(String schoolId);


    /**
     * 获取课程库
     *
     * @param schoolId
     * @param term
     * @return
     */
    List<BaseCourse> getBaseCourse(String schoolId);

    /**
     * 获取环节库
     *
     * @param schoolId
     * @return
     */
    List<BaseLink> getBaseSegment(String schoolId);

    /**
     * 发送日志消息
     *
     * @param schoolId
     * @param userId
     * @param userName
     * @param operationTerminal
     * @param operationType
     * @param operationContent
     */
    void uploadLog(String schoolId, String userId, String userName, String operationTerminal, String operationType, String operationContent, String taskId);

    /**
     * 开课计划开放申请提醒
     *
     * @param setBeginTime
     * @param setEndTime
     * @param taskId
     * @param userId
     * @param userName
     */
    void sendOpenCoursePlanApplyMsg(LocalDateTime setBeginTime, LocalDateTime setEndTime, Integer taskId, String userId, String userName);

    /**
     * 教学任务开放处理提醒
     *
     * @param setBeginTime
     * @param setEndTime
     * @param taskId
     * @param userId
     * @param userName
     */
    void sendOpenTeachTaskApplyMsg(LocalDateTime setBeginTime, LocalDateTime setEndTime, Integer taskId, String userId, String userName);

    /**
     * 选课开始提醒 学校通知
     *
     * @param setBeginTime
     * @param setEndTime
     * @param taskId
     * @param module
     * @param userId
     * @param userName
     * @param authorization
     */
    void sendSelectCourseStartMsg(LocalDateTime setBeginTime, LocalDateTime setEndTime, Integer taskId, String module, String userId, String userName, String authorization);

    /**
     * 选课结束提醒
     *
     * @param setEndTime
     * @param taskId
     * @param module
     */
    void sendSelectCourseEndMsg(LocalDateTime setEndTime, Integer taskId, String module, Integer roundId);
    HttpResponse sendSelectCourseEndMsg(Integer taskId, String roundName, String userId, String userName);

    /**
     * 取消开班
     *
     * @param teachingClassIds
     * @param taskId
     * @param userId
     * @param userName
     */
    void sendSelectCourseCancelMsg(List<Long> teachingClassIds, Integer taskId, String userId, String userName, String authorization);

    /**
     * 审核开课计划变更
     *
     * @param taskId
     */
    void sendCoursePlanExamineMsg(Integer taskId);

    /**
     * 开课计划变更审核
     *
     * @param msgCoursePlanExamine
     */
    void sendCoursePlanExamineResultMsg(MsgCoursePlanExamine msgCoursePlanExamine);

    /**
     * 处理时段调整
     *
     * @param msgTimeAdjustment
     */
    void sendTimeAdjustmentMsg(MsgTimeAdjustment msgTimeAdjustment);

    /**
     * 处理时段结束
     *
     * @param msgTimeAdjustment
     */
    void sendTimeAdjustmentEndMsg(MsgTimeAdjustment msgTimeAdjustment);

    UserInfo getUserInfo(String userId);

    ResponseObject syncAllScheduleToBasic(Integer taskId, String userId, String userName, String schoolId, Integer type);

    List<BaseGrade> getGrade(String schoolId);

    List<Retake> syncRetakeStudent(Integer taskId, String schoolId, String term);

}
